/**
 * 	 Copyright (c) 2008, 2009 Lukas Zaruba
 * 
 *   This file is part of UniAnalyzer (Universal Analyzer).
 *
 *   UniAnalyzer is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   UniAnalyzer is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with UniAnalyzer. If not, see <http://www.gnu.org/licenses/>.
 */

package net.zarubsys.unianalyzer.dataminers.lpt.gui.parameterObject;

import java.io.Serializable;

import net.zarubsys.unianalyzer.dataminers.lpt.pin.CustomizedPin;

/**
 * StartStopData
 * 
 * @author &lt;A
 *         HREF=&quot;mailto:lukas.zaruba@media-solutions.cz&quot;&gt;Lukas
 *         Zaruba&lt;/A&gt;, MEDIA SOLUTIONS CZECH REPUBLIC Ltd.
 * @version $Revision$ $Date$
 */
public class StartStopData implements Serializable, Cloneable {
	private static final long serialVersionUID = -4568645753070816345L;
	
	private boolean useStartTrigger;
	private CustomizedPin startTriggerPin;
	private int maxWaitingInterval;
	private int maxWaitingIntervalUnits;
	private boolean risingEdge;

	private boolean stopByTime;
	private int measureTime;
	private int measureTimeUnits;
	
	public int getMaxWaitingIntervalUnits() {
		return maxWaitingIntervalUnits;
	}

	public void setMaxWaitingIntervalUnits(int maxWaitingIntervalUnits) {
		this.maxWaitingIntervalUnits = maxWaitingIntervalUnits;
	}

	public boolean isRisingEdge() {
		return risingEdge;
	}
	
	public void setRisingEdge(boolean risingEdge) {
		this.risingEdge = risingEdge;
	}
	
	public int getMeasureTimeUnits() {
		return measureTimeUnits;
	}

	public void setMeasureTimeUnits(int measureTimeUnits) {
		this.measureTimeUnits = measureTimeUnits;
	}

	private int sampleCount;

	public boolean isUseStartTrigger() {
		return useStartTrigger;
	}

	public void setUseStartTrigger(boolean useStartTrigger) {
		this.useStartTrigger = useStartTrigger;
	}

	public CustomizedPin getStartTriggerPin() {
		return startTriggerPin;
	}

	public void setStartTriggerPin(CustomizedPin startTriggerPin) {
		this.startTriggerPin = startTriggerPin;
	}

	public int getMaxWaitingInterval() {
		return maxWaitingInterval;
	}

	public void setMaxWaitingInterval(int maxWaitingInterval) {
		this.maxWaitingInterval = maxWaitingInterval;
	}

	public boolean isStopByTime() {
		return stopByTime;
	}

	public void setStopByTime(boolean stopByTime) {
		this.stopByTime = stopByTime;
	}

	public int getMeasureTime() {
		return measureTime;
	}

	public void setMeasureTime(int measureTime) {
		this.measureTime = measureTime;
	}

	public int getSamplesCount() {
		return sampleCount;
	}

	public void setSampleCount(int sampleCount) {
		this.sampleCount = sampleCount;
	}
	
	@Override
	public int hashCode() {
		int hash = 19;
		if (useStartTrigger) {
			hash *= 17;
			hash ^= 23;
		}
		if (risingEdge) {
			hash *= 13;
			hash ^= 27;
		}
		if (stopByTime) {
			hash *= 3;
			hash ^= 5;
		}
		if (startTriggerPin != null) {
			hash ^= 17 * startTriggerPin.hashCode();
		}	
		hash *= (maxWaitingInterval * maxWaitingIntervalUnits * measureTimeUnits) ^ measureTime;
		return hash;
	}
	
	@Override
	public Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

}

/*
 * $Log$
 */